#ifndef PFS_MSG_QUEUE
#define PFS_MSG_QUEUE
#include <event.h>
#include <cstdlib>
#include "Lock.h"
#include <queue>
#include "config.h"

using namespace std;
namespace PFS
{
    class MsqQueue
    {
        public:
            MsgQueue(struct event_base *base)//,callback fun);
            virtual ~MsgQueue();
            int push(void* data);
            int length();
            static void pop(int fd, short flags, void *arg);
        private:
            int receive_fd;
            int send_fd;
            struct event ev;
            Mutex mutex;
            queue<void*> _queue;
    };
}
#endif
